{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from KNN.lr import LinearRegression2\n",
    "from sklearn import datasets\n",
    "from matplotlib import pyplot as plt\n",
    "from sklearn.model_selection import train_test_split\n",
    "from KNN import metrics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "bst=datasets.load_boston()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=bst.data[:,5]\n",
    "y=bst.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x1a17c30d68>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJztnX+QHOWZ37/Pjho0i8+MwGsHBmThS0q643RizZYhpypXJF9QbGy8Eb9M4SuScoX84UqMTe1ZTjlGXJGgi3KB++PKV5SdHCl8WCDsNZg6y1eGS+qoAkdi2eN0oLrYgOQRMfKhwUYaxOzukz9mejQz22/32z39e76fKtWuZqa7n+7e+b5vP8/zPo+oKgghhBSfiawNIIQQEg8UdEIIKQkUdEIIKQkUdEIIKQkUdEIIKQkUdEIIKQkUdEIIKQkUdEIIKQkUdEIIKQlr0jzY+973Pt2wYUOahySEkMJz6NChX6jqVNDnUhX0DRs24ODBg2kekhBCCo+IvGbzObpcCCGkJFDQCSGkJFDQCSGkJFDQCSGkJFDQCSGkJFhluYjIqwB+BWAZ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ADwP7putG+IyHlZG5UwnwHwcNZGJIGqNgD8VwBHAbwO4C1V/WG2ViXC3wL4qIhcKCKTAD4B4FLbjSnoAETkkwDeUNVDWduSEltV9cMAPg7g8yLy0awNSoA1AD4M4OuqOg3gFIBd2ZqUHF2X0nUAHs3aliQQkXUAPg3gMgAXAzhPRD6brVXxo6ovAfhDAH8J4AcAFgEs2W5PQe+wFcB1IvIqgG8D2C4iD2VrUnKo6vHuzzfQ8bd+JFuLEuFnAH6mqs91/78fHYEvKx8H8Lyq/jxrQxLidwG8oqonVLUN4DsAfidjmxJBVb+pqh9W1Y8CeBOAlf8coKADAFT1K6p6iapuQOex9SlVLd3oDwAicp6I/Jr7O4Br0HnMKxWq+v8AHBMRt8P0xwD8XYYmJc0tKKm7pctRAFeLyKSICDr386WMbUoEEXl/9+d6ADsR4r4yy2X8+ACA73a+E1gD4M9V9QfZmpQY/w7At7ruiJ8C+NcZ25MIXV/rPwfwb7O2JSlU9TkR2Q/geXRcEAso74rRx0TkQgBtAJ9X1ZO2G3KlKCGElAS6XAghpCRQ0AkhpCRQ0AkhpCRQ0AkhpCRQ0AkhpCRQ0AkhpCRQ0AkhpCRQ0AkhpCT8f9F55igLg2gbAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10e1ef160>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=x[y<np.max(y)]\n",
    "y=y[y<np.max(y)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x1a1af896d8>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABH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Nyd9riSICL3iMgJEfmJiDwuImvSHlMSROTLred4IurPku1z230ZwKsA3p32QAbgelUtei3vnwH4nqreJiKrAIylPaB+U9WTALYDzQkJgBqAb6c6qASISBXAfwbwO6paF5EnAHwWwF+lOrA+E5F/AeA/APgYgIsAviciB1X1pza35wy9RUSuBHAjgL9MeyzUOxF5N4BPAPgGAKjqRVWdT3dUifskgJ+patY378U1CqAsIqNofjifTnk8SfgIgBdVdUFVFwH8LwD/1vbGDOiXPAzgjwEspz2QAVAA3xeRoyJyV9qDScgHAZwB8D9babS/FJG1aQ8qYZ8F8Hjag0iCqtYA/FcApwC8CeCcqn4/3VEl4icAPiEi7xGRMQB/AOAq2xszoAMQkU8DeEtVj6Y9lgHZoaofBfD7AL4kIp9Ie0AJGAXwUQB/oaoTAM4D2JPukJLTSindDODJtMeSBBFZB+AzADYD2ABgrYj8Ybqj6j9VfRXA1wD8AMD3ABwHsGh7ewb0ph0AbhaR1wF8C8BOEflmukNKjqqebv35Fpr51o+lO6JE/ArAr1T1pdbfn0IzwBfV7wN4WVV/nfZAEvJ7AH6hqmdUtQHgGQC/m/KYEqGq31DVj6rqJwC8DcAqfw4woAMAVPVeVb1SVTeh+bX1sKoW7tMfAERkrYi8y/1/ADeg+TWvUFT1/wF4Q0TcE6Y/CeDvUxxS0j6HgqZbWk4BuE5ExkRE0Px5vprymBIhIu9r/bkRwC2I8HNllcvweT+AbzffExgF8Deq+r10h5SY/wTgsVY64ucA/n3K40lEK9f6KQD/Me2xJEVVXxKRpwC8jGYKYg7F3TH6tIi8B0ADwJdU9aztDblTlIioIJhyISIqCAZ0IqKCYEAnIioIBnQiooJgQCciKggGdCKigmBAJyIqCAZ0IqKC+P9sMPGvRlef5wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a1af22d30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "x_train,x_test,y_train,y_test=train_test_split(x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(367,)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "lr2=LinearRegression2()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression2"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lr2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression2"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lr2.fit(x_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8.265052422361041"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lr2.a_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x10e27ba58>]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQ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I3hz2uqBCRW0TkDRF5XUSWikjRJ/mw5OKAiNwKIAngGFWdEvZ4okJEdgFIqir7idOIyGIAP1fVh0RkGIARqtod9riiRESqYJx0doGqluvaFN+ISB3H8It/AAAB4ElEQVSAXwA4Q1V7RGQFgOdU9cfFvA5n6AWIyBgAkwE8FPZYKPpE5BgAfwzgYQBQ1cMMc0uXAtjBMM8wFEC1iAwFMAIuzmhmoBf2AIDbAQyEPZAIUgAviEi7iMwKezARcRqALgA/SpXpHhKRo8IeVARdDWBp2IOIClXtBPAvAHYD2AfgQ1V9odjXYaDnISJTAOxX1fawxxJRjap6LoBJAL4jIn8c9oAiYCiAcwH8p6o2APgIQHO4Q4qWVBlqKoAnwh5LVIjIKABXABgL4GQAR4nItcW+DgM9v0YAU1O14mUAJorIY+EOKTpUdW/qz/0AngLwxXBHFAl7AOxR1ddSX6+EEfA0aBKATar6ftgDiZDLAOxU1S5V7QXwJICLi30RBnoeqnqHqo5R1XoYvyKuV9WiPzXjSESOEpFPm38H8GUAr4c7qvCp6v8AeE9ExqcuXQrgtyEOKYpmgOWWbLsBXCgiI0REYPzvZluxLzLU92FRpTgBwFPG//YwFMDjqvrTcIcUGf8PwJJUaeEdAH8d8ngiQ0RGAPgSgG+FPZYoUdXXRGQlgE0A+gB0wMWqUbYtEhHFBEsuREQxwUAnIooJBjoRUUww0ImIYoKBTkQUEwx0IqKYYKATEcUEA52IKCb+P69f20eLi0WIAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10e27bbe0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x_test,y_test)\n",
    "plt.plot(x_test,lr2.predict(x_test),color='r')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "res=lr2.predict(x_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "34.59753087586858"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "metrics.mse(y_test,np.array(res))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5.881966582348848"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "metrics.rmse(y_test,np.array(res))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.0142158097831375"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "metrics.mae(y_test,np.array(res))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.56092833308755"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lr2.score(x_test,y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
